package com.controller;

import com.entities.CommonResult;
import com.entities.Payment;
import com.service.FeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 04-26-19:30
 */
@RestController
public class FeignController {

    @Resource
    private FeignService feignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> openFeignTest01(@PathVariable("id")Long id){
        return feignService.getById(id);
    }

    @PostMapping("/consumer/payment/insert")
    public CommonResult<Payment> openFeignTest(Payment payment){
        return feignService.create(payment);
    }

   @GetMapping("consumer/payment/timeout")
    public String openFeignTest(){
        return feignService.timeoutTest();
   }
}
